package br.com.velp.sudecap.serviceimpl;

import br.com.velp.sudecap.comum.SpringConstants;
import br.com.velp.sudecap.dao.ConsulenteDAO;
import br.com.velp.sudecap.entidade.Consulente;
import br.com.velp.sudecap.service.ConsulenteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Eduardo
 */
@Service("consulenteService")
@Transactional(readOnly = true)
@Lazy(SpringConstants.LAZY_BEANS)
public class ConsulenteServiceImpl implements ConsulenteService {
    
    @Autowired
    private ConsulenteDAO consulenteDAO;

    @Override
    @Transactional(readOnly = false)
    public Long salvar(Consulente value) throws Exception {
        return this.consulenteDAO.salvar(value);
    }

    @Override
    @Transactional(readOnly = false)
    public void atualizar(Consulente value) throws Exception {
        this.consulenteDAO.atualizar(value);
    }

    @Override
    public Consulente obterPorId(Long id) {
        return this.consulenteDAO.obterPorId(id);
    }

    @Override
    @Transactional(readOnly = false)
    public void excluir(Consulente value) throws Exception {
        this.consulenteDAO.excluir(value);
    }
    
}
